//
//  QuestionAnswerTableViewCell.m
//  MingShi
//
//  Created by MJiao on 15/7/4.
//  Copyright (c) 2015年 MJiao. All rights reserved.
//

#import "QuestionAnswerTableViewCell.h"

@implementation QuestionAnswerTableViewCell

- (void)awakeFromNib {
    UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapDetected)];
    singleTap.numberOfTapsRequired = 1;

    [self.ivAnswerImage setUserInteractionEnabled:YES];
    [self.ivAnswerImage addGestureRecognizer:singleTap];
}

- (void)tapDetected {
//    NSLog(@"您点击了评论中的图片!!!!");

    NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];

    [userInfo setObject:self.willViewingImageUrl forKey:@"answerImageUrl"];
    [userInfo setObject:self.willViewingResizeImageUrl forKey:@"answerResizeImageUrl"];

    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
    [notificationCenter postNotificationName:@"recvViewAnswerImage" object:self userInfo:userInfo];

}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)btnAcceptionAction:(id)sender {

    NSLog(@"事件触发....");

    NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
    NSString *strAnswerId = [NSString stringWithFormat:@"%ld", self.answerId];
    [userInfo setObject:strAnswerId forKey:@"answerId"];

    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
    [notificationCenter postNotificationName:@"recvAppceptAnswer" object:self userInfo:userInfo];


}
@end
